package lanQiaoBei.基础算法.双指针;

import java.io.*;
import java.util.Arrays;

/*
 * 将一个整数序列排序并去重
 * */
public class P3 {
    static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    static int n;
    static int[] a;

    public static void scan() throws Exception {
        n = Integer.parseInt(br.readLine());
        a = new int[n];
        String[] ss = br.readLine().split(" ");
        for (int i = 0; i < n; i++) {
            a[i]=Integer.parseInt(ss[i]);
        }
    }
    public static int unique(int[]a){//双指针
           int j=0;
           for(int i=0;i<n;i++){
               if(i==0||a[i]!=a[i-1]){
                   a[j++]=a[i];
               }
           }
           return j-1;
    }
    public static void erase(int[]a,int b,int e){
           while(b<=e){
                a[b]=0;
                b++;
           }
    }
    public static void main(String[] args) throws Exception {
        scan();
        Arrays.sort(a);
        int index = unique(a);
        erase(a,index+1,a.length-1);
        for(int i=0;i<n;i++)
            System.out.print(a[i]+" ");
    }
}
